<style>
.affix{top:10px;}
.head-style-list li,.editor-template-list li{cursor: pointer;}
</style>

		<div class="ui-portlet">
			{{template wxes/_user_wxes}}
			<ol class="breadcrumb">
			  <li><a href="/users/index"><i class="fa fa-home"></i>&nbsp;&nbsp;个人中心</a></li>
			  <li><a href="/wx_storefronts/mine">服务门店</a></li>
			  <li class="active">新增|编辑</li>
			</ol> 
		</div>          
       <hr>

{{$this->Form->create('WxStorefront',array('class'=>'form-horizontal','role'=>'form'))}}
	<ul class="nav nav-tabs"  role="tablist">
    	<li role="presentation" class="active"><a href="#eng-info" aria-controls="home" role="tab" data-toggle="tab">英文</a></li>
    	<li role="presentation"><a href="#chi-info" aria-controls="home" role="tab" data-toggle="tab">中文</a></li>
		<li></li>
	</ul>
	
	<div class="tab-content">
		
		<div role="tabpanel" class="tab-pane active" id="eng-info">
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontName">门店名称</label>
				<div class="col-sm-9 controls">
					{{$this->Form->hidden('id')}}
					{{$this->Form->hidden('locale',array('value'=>'en_us'))}}
					{{$this->Form->input('name',array('class'=>'form-control','div'=>false,'label'=>false))}}
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontName">副标题</label>
				<div class="col-sm-9 controls">
					{{$this->Form->input('sub_title',array('class'=>'form-control','div'=>false,'label'=>false))}}
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontCateId">门店类型</label>
				<div class="col-sm-9 controls select">
					{{$this->Form->input('cate_id',array('class'=>'form-control','div'=>false,'label'=>false))}}
					<p><a href="{{$this->Html->url(array('controller'=>'user_cates','action'=>'add','WxStorefront'))}}">新增门店类型</a></p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontCoverImg">封面图片</label>
				<div class="col-sm-9 controls select">
					{{$this->Swfupload->load('coverimg',array(
					'label'=>false,'modelClass'=>'WxStorefront',
					'no_db'=>1,'upload_limit'=>1,
					'file_types'=> '*.jpg;*.gif;*.png;*.bmp',
					'isadmin'=>false
					))}}
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontCateId">所属城市</label>
				<div class="col-sm-9 controls select">
					{{$this->Form->input('city_id',array('class'=>'form-control','div' => false,'label' => false))}}
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontMsgType">地址</label>
				<div class="col-sm-9 controls">
					{{$this->Form->input('address',array('class'=>'form-control','div'=>false,'label'=>false,))}}
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontPriority">经纬度</label>
				<div class="col-sm-9 controls form-inline">
					{{$this->Form->input('longitude',array('class'=>'form-control','placeholder'=>__('Longitude'),'div'=>false,'label'=>false,))}}
					&nbsp;&nbsp;
					{{$this->Form->input('latitude',array('class'=>'form-control','placeholder'=>__('Latitude'),'div'=>false,'label'=>false,))}}
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontMsgType">电话</label>
				<div class="col-sm-9 controls">
					{{$this->Form->input('telephone',array('class'=>'form-control','div'=>false,'label'=>false,))}}
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontMsgType">营业时间</label>
				<div class="col-sm-9 controls">
					{{$this->Form->input('business_hours',array('class'=>'form-control','rows'=>'3','div'=>false,'label'=>false,))}}
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontMsgType">排序时间</label>
				<div class="col-sm-9 controls datetime form-inline">
					{{$this->Form->input('created',array('class'=>'form-control','div'=>false,'label'=>false,))}}
					<p>按时间从先到后的顺序排列，时间越早的排越前面</p>
				</div>
			</div>
		
			<div class="form-group" id="divWxStorefrontUrl">
				<div class="col-sm-12 controls">
					{{$this->Form->input('content',array('class'=>'form-control','div'=>false,'label'=>false,'rows'=>'3'))}}
				</div>
			</div>
		</div>
		<div role="tabpanel" class="tab-pane" id="chi-info">
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontI18nName">门店名称</label>
				<div class="col-sm-9 controls">
					{{$this->Form->hidden('WxStorefrontI18n.zh_cn.id')}}
					<!--{{$this->Form->hidden('WxStorefrontI18n.zh_cn.locale',array('value'=>'zh_cn'))}}-->
					{{$this->Form->input('WxStorefrontI18n.zh_cn.name',array('class'=>'form-control','div'=>false,'label'=>false))}}
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontI18nSubTitle">副标题</label>
				<div class="col-sm-9 controls">
					{{$this->Form->input('WxStorefrontI18n.zh_cn.sub_title',array('class'=>'form-control','div'=>false,'label'=>false))}}
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontI18nAddress">地址</label>
				<div class="col-sm-9 controls">
					{{$this->Form->input('WxStorefrontI18n.zh_cn.address',array('class'=>'form-control','div'=>false,'label'=>false,))}}
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" for="WxStorefrontI18nBusinessHours">营业时间</label>
				<div class="col-sm-9 controls">
					{{$this->Form->input('WxStorefrontI18n.zh_cn.business_hours',array('class'=>'form-control','rows'=>'3','div'=>false,'label'=>false,))}}
				</div>
			</div>
			<div class="form-group" id="divWxStorefrontI18nContent">
				<div class="col-sm-12 controls">
					{{$this->Form->input('WxStorefrontI18n.zh_cn.content',array('class'=>'form-control','div'=>false,'label'=>false,'rows'=>'3'))}}
				</div>
			</div>
		</div>
	</div>
	
	
	<div class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9"><input class="btn btn-primary" type="submit" value="提交"></div>
	</div>
{{$this->Form->end()}}

{{$this->Html->script(array(
	'ckeditor/ckeditor.js',
	'swfupload/swfupload.js',
	'swfupload/swfupload.queue.js',
	'swfupload/swfupload.cookies.js',
	'swfupload/fileprogress.js',
	'swfupload/handlers.js',
))}}

<script>

var current_ckeditor_instance = null;

$(function(){
	$('#left-side-affix').width($('#left-sidebar').width());

	CKEDITOR.editorConfig = function( config ){
		config.toolbar = 'FRONT';
	}
	ckeditors['WxStorefrontContent'] = CKEDITOR.replace( 'WxStorefrontContent',
		    {
		        customConfig : '{{$this->Html->url("/js/ckeditor/front-config.js")}}'
		    });
	ckeditors['WxStorefrontContent'].on('focus',function(e){
		current_ckeditor_instance = e.editor;
	});
	
	ckeditors['WxStorefrontI18nZhCnContent'] = CKEDITOR.replace( 'WxStorefrontI18nZhCnContent',
		    {
		        customConfig : '{{$this->Html->url("/js/ckeditor/front-config.js")}}'
		    });
	ckeditors['WxStorefrontI18nZhCnContent'].on('focus',function(e){
		current_ckeditor_instance = e.editor;
	});
	
	
});
</script>